In bitcoin, a longer chain will cause a reorg if it's not the "main-chain", where some blocks' side-effects will be reverted, and others in another branch will be processed and become part of the main-chain. I can't find any resources on how Cardano does that and whether it's done in the same way.
So my question is, how does Cardano handle reorgs? Is it exactly like Bitcoin, where it stores all orphans and decides where to go based on the longest chain rule? Or is it like Polkadot/Substrate, where it just stores all block candidates in memory and drops them once blocks are finalized? Or is it something else?