Why Was I Liquidated Even With a Stop Loss?

A stop loss is your request to close a trade at a certain price. Liquidation is the exchange closing it to protect itself. If the exchange's trigger comes first, or your stop cannot be filled in time, the stop never gets its turn. That is the whole answer, and it usually comes down to leverage.
Your stop was further away than the liquidation price
With high leverage the liquidation price sits very close to your entry. At 50x on Bitcoin, a move of roughly two percent against you is enough. A stop placed three percent away is simply behind the exchange in the queue — the position is gone before the price ever reaches it. Open the position details, compare the liquidation price with your stop, and if the stop is the further of the two, it was never going to fire.
Different prices, different triggers
Exchanges liquidate on the mark price, a smoothed index built from several spot markets, while a stop order can be set to watch the last traded price of that one contract. In a sharp move the two drift apart, and the mark price can reach the liquidation level while the last price has not yet reached your stop. Binance and Bybit both let you pick the trigger source; most people never open that setting.
The stop existed but could not be filled
A stop-limit order becomes a limit order at a price you chose. If the market jumps straight past it, it waits unfilled while the position keeps losing — and the liquidation engine does not wait. A stop-market order avoids that, because it takes whatever price is available. It is the difference between telling a taxi driver "only at this fare" and "just drive".
The practical fix is not a tighter stop but less leverage: at 5x, the liquidation price is far enough away that your stop is the first thing the market meets. Check where both sit before you open a trade, not after. Next, see why a stop loss may not trigger as expected and what a liquidation deducts from your balance.