During a raid, villagers flee from illagers and run towards the nearest residence, similar to a zombie siege. For any villager to hide, the house should have a door and a minimum of 1 mattress. In Java Edition, villagers can be pushed on beds and sometimes turn their heads. https://financefeeds.com/maplestory-universe-announces-second-pioneer-test-date-with-exclusive-events-and-in-game-rewards/