High volume leads to narrower bid-ask spreads and lower trading costs.
The cost $S$ of trading a stock should be measured as
$$S = X \left( \frac{\bar{P} }{ P_\rm{mid} } - 1\right)$$
where $X$ is the direction of your trade (1 for buy, -1 for sell) , $\bar{P}$ is the weighted average price that you trade at and $P_\rm{mid}$ is the arrival mid price, ie the mid price at the time you sent the order. This is a very noisy measure of trading cost, but over sufficiently many orders you can get a good idea of your average cost to trade.
Note that the bid-ask spread is only one variable which explains the cost to trade a particular stock. It is an important variable if you are trading a small order and you want near-instantaneous execution, because the only way to do that is to cross the spread and pay the offer/lift the bid.
For larger orders, the most important determinant of trading cost is order size relative to the volume traded in the market, ie $v/V$ where $v$ is the size of your order and $V$ is the market volume.
This is because there will not be enough size on the bid/offer to fill your order in one trade. Assume you are trying to buy. You will either need to take out multiple levels in the order book (which causes $\bar{P}$ to be higher mechanically) or start placing passive orders at or near the best offer (which indicates your trading intention to the market, and causes the market to move up, resulting in higher $\bar{P}$). Markets with larger volume will have larger sizes on the bid and offer, and respond less to a new passive order of a given size. Many cost models take the cost to be proportional to the square root of $v/V$.
Other variables that affect cost are volatility (more volatile stocks cost more) and proximity to major announcements (eg earnings, macroeconomic figures) where it costs more to trade shortly before a big announcement.
As for why a higher volume leads to lower trading cost, the main reason is that market makers who get into a position don’t need to wait as long to naturally offset the risk with a trade in the other direction. Therefore they are comfortable quoting a smaller bid-ask spread (don’t need to earn as much up front to offset their risk) and in larger size (happy to take on a larger position because they know they can get out more easily).