Similar to the right click function of a MacBook, 3D Touch opens up menus, different app options, and content previews.
A 3D Touch press on a supported app on the iPhone Home screen brings up "Quick Actions," for example, which are shortcuts, while "Peek" gestures can be used within apps like Safari, Messages, and Mail to preview content. Longer "Pop" gestures are used after "Peeks" to open content, and there are also other capabilities enabled with 3D Touch like pressure-sensitive drawing and a keyboard trackpad for quick cursor movements.
3D Touch is available in stock Apple apps and in third-party apps that have built in support using 3D Touch APIs.
The iPhone XR mimics some aspects of 3D Touch with a "Haptic Touch" that combines a long press with haptic feedback to access 3D Touch options. It's only available for some functions, however, as in other areas of the operating system it would conflict with existing long press functionality.