When the offensive player loses possession and it goes out of the defending team's end zone
the ball is automatically dead and it defaults to the team who is defending that end zone. You can think of it as the ball being lost in enemy territory.
I think it makes sense because it puts a little more emphasis on not making any mistakes in that critical area and makes scoring a touchdown more of an accomplishment.