All traders know there will come a time when you are hailed, intercepted and boarded and you'd damned well better make the right decisions or risk getting your freighter shot to pieces, see your crew get shot to pieces and lose everything.
The enemy has the weapons, has the troops, and the skill. They are the Patrol!
The Fleet is the creation of a number of advanced and populated worlds. It exists to preserve the status quo, the fat freighter plying their way between major centers of commerce. They have the tax base to let them by the big ships, pay their crews the premium salaries and get the best and brightest. Any pirates operating in the core worlds better have a masterful plan, make their score and then go into cold sleep for a few hundred years.
Out on the Frontier ... there is still commerce and trade (much of it legal). There are also pirates as always. The Frontier has the Patrol, armed well enough to raise merry Hell with one or more pirate ships. It's a smaller, leaner operation and it is chronically underfunded. The worlds that support it have less money, less of s pool of skilled crew. They need as many ships as possible to cover as many hot spots as possible. How do they pay for this?
The business model is simplicity itself. Most traders smuggle at least part of the time. Nearly everyone's smuggled at least once. Make a trader pull over and you have a decent chance of finding some swag. What then? The Patrol does not maintain extensive correctional facilities and most planetary governments don't want the refuse of space crowding out their native felons. The easiest ways to punish for nonviolent crimes is fining, suspending licenses, and exile.
Under fines read confiscating your cargo (all of it) and maybe your ship for a serious enough smuggling offense. Knowing what goods are contraband or may be regarded as such on your port of cal is a big job. It's where your deckmasters pay for themselves several times over.
For a big enough offense the entire ship may be forfeit. This rarely happens because one case of this can scare the free traders away for years. It is a great tool for starting up your own shipping line and keeping outsiders from competing with you. But then your trade efforts might still be hampered for some time. Other free traders may not want to support an organization that started out screwing their own.
The Banks have a handy solution to the immense power of asset forfeiture the Patrol wields. In the case of a mortgaged ship being seized, only part of that ship belongs to the offending party. The rest belongs to the Bank and in such cases the Patrol gladly hands over the ship in exchange for a fraction of the principal already paid to the Bank. The Bank gets a ship back that it can mortgage again, the Patrol gets a fat check, and evildoers are punished. Sometimes Banks even let these ships go cheap since they are often used. there might be problems with former owners seeking to steal the ship for various reasons (hidden compartments, vital information encoded on the computer etc.)
Please note in many cases the Bank turns right around and remortgages the ship to the same poor slob that it was confiscated from. Hey, crews don't grow on trees, every day that ship is sitting in a port it could be earning money for the shareholders. Besides, the so called lawbreakers already passed a background check once! So they broke a local law! It happens.
Note that the Patrol could sell these confiscated ships and pay the rest of the principle in the mortgage, but seldom has the interest or networking to get a good price. Also the Banks pay taxes and wield a lot of clout in many local governments. You don't want to tick them off.
Less extreme than asset forfeiture is the phenomenon of spot inspections. A bunch of Patrol inspectors boards you and finds your vessel to be a flying deathtrap. Stiff fines ensue! Or someone 'notes/ a leak of a vital commodity (fuel, propellant, air) just as it is vented explosively (did someone nudge a switch?). What a pity. The nice Patrol Captain is willing to sell your some more fuel or whatever at triple cost.
All these dirty trick can be done by space port inspectors. They aren't done commonly because the Patrol usually gets to traders first and getting gouged by a Patrol ship is avoidable in theory, if they can't intercept. The way you avoid gouging on planet is avoiding that planet. Not good for business.