In ROS-1, the user code would connect to the ROS client libraries (such as rospy or roscpp) and they would communicate directly with other nodes from within the network, whereas in ROS-2, the ROS client libraries act like an abstraction layer and connect to another layer that communicates with the network using other nodes through DDS implementation. A simple comparison is shown here:
As you can see, in ROS-2, the communication with the OS layer and further down to the hardware layer is done through DDS implementation. The DDS component in the preceding diagram is vendor-specific and ...