system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do multiplayer games sync player actions with each other?

I know some of it has to do with the server side of things but at some point you have to lend some things on the client side, correct? I'm curious on what typical multiplayer games do server-side and client-side and make sure that everybody sees (mostly) the same thing while accounting for lag and all that.

Not necessary but I would also appreciate knowing how peer-to-peer vs. dedicated server environments tackle these issues as well.
gpt
Dedicated server: The basic run down is that your client shares information with the central server who then distributes the information to everyone else's clients (and gives you their data). Since all of this exchange is handled by the server, your client (and device) just has to handle decoding the incoming data and sending your new data to the server. To ensure players "see" the same thing, time stamps and packet numbering is used in addition to some predictive measures on the client side (sometimes not always). The server tries to balance all the lag/latency by sending the smallest packet of information possible; all the participants' clients will try to do the same. Other latency/lag balancing measures is sending only information that is needed to the clients that need it. 

EXAMPLE: In Minecraft, only locations with active players need data to be sent to those players. So the player(s) in chunk (136, 250) get sent the data of that chunk and the chunks around it up to the render distance (typically between 8 and 16 chunks.) Any changes made in these chunks are sent back to the server who then sends the updated data back to the players; these packets are quite small as ONLY the changes in blocks (which is about 3 bytes in size per block) and player locations are sent (these changes can be larger in size than block data as they tend to be vectors of about 8 bytes in size, but also the server uses some predictive measures to ~~guess~~ calculate what a player's new location will be.)

Peer-to-peer: Pretty much the same, but instead of sending to a central server that then sends out to everyone, your client (and device) send the data directly to everyone else's client. This method does not have a great way of handling lag/latency as packet numbering can vary between peers. Also since your device's internet connection is now having to handle multiple connections to other players, instead of just one connection to the server, it can run into bandwidth issues. The same smallest data packet principal applies here as well.