These data packets serve same reason in Internet as frames on LAN. Every packet has a header. Routers, which are normally gateways, transfer packets between physical networks.
These data packets have a uniform hardware-independent message format. They add header and data and can't use format from any particular system. They are closed in hardware frames from delivery across every physical network.