Arbitrage is the thing most people understand innately. You spot a shop is selling umbrellas for £9.99, but a shop around the corner is selling them for £10. So if you buy an umbrella from the first shop and sell it to the second you've made... a penny in profit, which is a huge waste of time. But if you can use your leverage to borrow £9.99 billion and buy a billion umbrellas, you'll make £10 million in profit. This is usually where hedge funds shine, because they have the leverage to make a lot of money on tiny price differences.
Basis trading hinges on futures. Farmer John grows onions, and currently sells onions for £9 a sack. Meanwhile Mr Groats the Grocer is looking at placing a purchase order for 3 months in the future. Mr Groats could make a deal with Farmer John that in July, he can buy 100 sacks of onions for £10 a sack. Farmer John's going to be happy if there's an onion glut, because it means he'll get paid more for his onions than he'd get on the market in July. Mr Groats is going to be happy if there's an onion blight, because it means he's getting onions way cheaper than what he'd pay on the market in September. Both of them are hedging their risk with this contract. But they're also willing to buy and sell with you.
The gap between the cost of onions and their futures price (£1) is the basis, and you can make money if you assume the difference between onions now and onions in September will narrow, which it normally does. So what you do is you buy 100 sacks of onions off of Farmer John right now for £900, and store them. You also write a contract with that says "I'll sell you 100 sacks of onions to you for £10 a sack in July" and sell that contract to Mr Groats for £1000, and he buys the futures contract because it seems like a reasonable deal. By July onions are selling for £9.80 and onion futures for delivery in September are trading for £9.90. The futures contract is a bit ropey for Mr Groats because he'd be overpaying for onions, so you buy it back off him for £990. You can also sell your onions at market price. So you make £80 (less costs incurred from storage) on the onions, and also make £10 on your futures contract shenanigans.
In practice this is offset in the market so you end up with a contract to buy onions for £9,90 a sack and another contract sell onions for £10 a sack, so you cancel them out and end up with 10p profit a sack. If you long the basis - buy loads of onions and sell futures - you're making a bet that onions will be in short supply in July and will cost more, so you've locked sellers into a disfavourable position. If you short the basis - sell off your onions and buy futures - you're making a bet that onions will be really cheap and you've locked buyers into a disfavourable position.
In the latter case, you've acquired lots of "sell onions for £10" contracts. Some investors did this in the 50s by hoarding onions and then flooding the market, bankrupting a load of onion farmers whose onions had become worthless, and that's why onions are
no longer allowed to be traded as a commodity in the US.
Swap trading is the other aspect at play here. Imagine you want rental income. You could buy a house and rent it out. But if you don't want to do that, you find a property owner and say "I'll pay you £3000 a month and in return you give me the total rental income". If the rental market goes to shit then you want to be the property owner in this scenario, because you'll get more through the fixed swap payments than from the dynamic rental income. If the market goes well, then you want to be the swap contract holder, because the dynamic rental income is more than the fixed swap payments. If you notice a swap contract and rental income on a property are really mismatched but shouldn't be, you can make money by acquiring the house and waiting for rental payments to drop, or acquiring the swap contract and waiting for rental payments to rise.