So transaction order is important, but who looks after this? Bitcoin miners.
Bitcoin miners organize transactions into blocks and then compete against each other to solve complex mathematical puzzles. The first miner to solve the puzzle adds their block to the chain and is rewarded with new Bitcoins.
Why make miners solve complex puzzles? It makes it computationally impractical for an entity to change transactions fraudulently. To do so would require 51% of the network’s mining power, which makes it next to impossible if the puzzles are hard.