CarPlay is basically a second screen for your phone. Developers can optimize their apps for display on that screen. So for example your turn by turn map directions with a live map will appear on the large screen in the middle of your car's dash.
if you've got a homekit garage door. the open door button will magically appear when you get close to home.
Only certain categories of apps are allowed, to avoid distracting you from driving. so no video playback or text messaging apps, but a few audio and navigation apps.
Some cars have a smaller display built into the instrument cluster. Sometimes CarPlay can use those to display things like next turn in navigation, But that depends on your car's manufacturer and the individual app developers for that to work.