The success of 5G wireless networks (5G) substantially relies on efficiently embracing machine-type communications (MTC), intended to support autonomous exchange of data between devices. Typical MTC applications include smart metering, e-health care, environmental and structural monitoring, and asset tracking. Therefore, MTC is an essential component of Smart Cities and the Internet of Things (IoT). However, cellular networks have traditionally been designed to efficiently handle human-to-human (H2H) traffic, whose characteristics greatly differ from those of MTC traffic. Only recently the cellular networks started to be optimized for MTC and, in that sense, a special focus has been put on the Random Access (RA), which occurs whenever a device requests initial access to a base station (BS). Specifically, the RA mechanism of cellular networks is based on the slotted ALOHA protocol, whose efficiency degrades rapidly as the number of users increases, also presenting a large signaling overhead when short packets are transmitted. The RA channels are further challenged by massive MTC (mMTC) applications, where a great number of MTC devices attempt to access the BS, while the class of MTC applications with strict latency requirements is challenged by the signaling overhead. These problems have been inherited from the H2H-oriented cellular systems and, while numerous solutions have been proposed, there is still no consensus on the MTC enhancements for the second phase of 5G standardization.