I would say that an important part of the trading cost is ultimately shaped by the balance of informed (those with private information) and non-informed (liquidy traders) market participants. Imagine a market maker in a market with only non-informed traders that randomly sell att the bid and buy at the ask. The cost for the market maker would be small and she would make money even from a tiny bid-ask spread.
Imagine instead a market with some informed traders. When they know their information would drive up the price above the ask they buy and the market maker will eventually in turn have to buy her inventory back at a higher price realising a loss. In response of course, she will widen her bid-ask spread and perhaps cut back on her volumes.
Not only does this balance shape the trading cost, the mere existence of the market relies on it. The larger the share of informed traders, the wider the spread. And with wider spreads the share of liquidity trades decrease as they shy away from the trading costs. In the end only the most informed traders remain and the market closes.
Such was the fate of the Japanese perp market, analysed in the paper "Liquidity Shocks, Systemic Risk, and Market Collapse:
Theory and Application to the Market for Perps".