The story
Setsubun means the division between seasons, and this one, winter into spring, was the one that mattered — the old year ending. The turn was held to be when demons get through.
So they are thrown out. Roasted soybeans are cast at the door and out of the window with the shout oni wa soto, fuku wa uchi: demons out, fortune in.