What the chain ID does
It is included in the signed payload so a transaction valid on one network cannot be replayed on another. This is why adding a network with the wrong chain ID produces signatures that no node will accept.
It is also how a wallet knows which network a site is requesting, and how it can warn you that you are on the wrong one.
What an RPC endpoint sees
Everything you ask it. Your address, your balance queries, your transaction before it is broadcast, and your IP address. A public endpoint is a service, and it is also an observer.
A hostile or compromised endpoint can return false balances, hide transactions, or delay broadcasting while it front-runs you. It cannot sign anything, which is the limit of the damage.
Adding networks safely
Get chain parameters from the network's own documentation or a reputable chain registry, not from a page that offers to add it for you. A malicious "add network" button can install a correct-looking network pointed at an endpoint the attacker controls.
Verify the chain ID matches the official value, and prefer an endpoint operated by the chain or a provider you chose.
When to care
Occasional use of a default public endpoint is fine for most people. If you transact at size, a private or paid endpoint removes both the observation and the reliability problem.
FBT Swap ships configured endpoints for its supported networks and shows the chain before every signature, so the network you are signing for is never implicit.