The host government is responsible for external security outside the embassy wall. The marines usually have responsibility for the inside. Most embassies have 9-11 marines. After 9-11 I think Pakistan increased to 22. So there is some responsibility for marines to provide protection.
Don’t recall marines at Benghazi, but I welcome information to the contrary.
I know how it works having worked at Embassies as the Management Officer. The RSO reported to me and the RSO supervises the MSG Detachment. The Marines are there primarily to protect classified information. They can provide limited personnel protection until the host government forces arrive.
The size of the MSG depends on a number of factors. Risk, the number of internal MSG posts, etc. will govern size. The minimum used to be 6.