Why is beirut the capital of lebanon?

i guess it kind of is in the centre of Lebanon and it kind of has everything in it like resources and shops and it's the biggest town in Lebanon.