In C# (and generally in programming) marshaling is the conversion between your typical memory representation (in C# it's your object) and the other ways (be it C struct, C string, utf8 string, or whatever received from socket.) that's why AllocGlobal is under Marshal. Not saying one should use it though... the only ones sane programmers would touch is probably to handle C structs returned from native code.
System.Marshal is a sort of catch-all for functions used to interact with unmanaged code, including things like Win32 error handling and COM in addtion to type conversion and unsafe memory access in general.
sorta.. if you're thinking gRPC and Protobuf, but because they're on the same machine and often in the same process, it's a pointers-wizzeled interface all provided by the layers it was built on... then it just maps types, responses, and their interfaces. P/Invoke is wizardry.