At my home I have my desktop computer behind a router. There's a port forwarded by the router to the computer's ssh port. When I am using my laptop in the same LAN, I can either connect to my desktop computer on 192.168.1.something or just connect to the router's address on the internet. Does it matter which way I do it in terms of routing, speed and ping?
If you're using the public IPv4 address (visible to the Internet), then the network traffic gets sent to the device with that address. That would be your router. This means your router needs to receive the traffic. Then, your router is noticing that there is a forwarded port, so it converts the network traffic's IP address and then sends the converted network traffic to the laptop. This is a heavier burden than required, overworking the router.
If you have a switch between your devices and the router, the switch may be getting used multiple times as well. Even if that's not the case and the router's multiple LAN ports are being used like a switch, using the internal addresses will allow the router to basically act like a switch when handling the traffic, which likely requires a lower burden on the router, meaning that the router can process the traffic more quickly.
Another benefit: If you use internal addresses, and then if your router dies, you can replace the router with a switch and your internal communication is much more likely to work with minimal (quite possibly no) change.