Mary and Joseph travelled here to be counted for the census which tells you how many people is in the country at the time. They travelled on a donkey and while they were there they were at the inn and because there was no room at the inn they went out the back to the stable and while they were out there Jesus was born.