They are selected in settings/CarPlay/widgets and are linked to the specific app. Meaning if the app developer added support for CarPlay, then it will automatically show up in the list
The purpose is to have limited use of a particular app. They come in extremly handy...for example I use the Calendar widget to display appointments and the Homekit widget to activate scenes. Its literally one swipe away (swipe right- from left edge)