RPC allows for remote procedure calls to be made across distributed systems in a similar way to local procedure calls. RPC uses stubs to pack and unpack arguments and results so that the calls appear transparent whether local or remote. RPC messages contain information about the procedure, arguments, and client for execution on the server and returning results. Marshalling converts data to a stream for transmission and decoding on the receiving end. Servers can be stateful, maintaining information across calls, or stateless, requiring all needed information be passed each time.