A gateway is a device or an application that connects two different types of protocols.
In the context of WebRTC, Gateways are used to connect a WebRTC service to another type of network.
Most WebRTC gateways tend to lean towards connecting WebRTC to SIP and IMS.
WebRTC Gateways almost always need to also transcode voice and video due to the fact that WebRTC’s codecs are different than what exist in other VoIP systems.