The documentation that you linked explicitly says how to generate the key, in the Get Application Server Keys
paragraph.
Another way is to use the web-push library (either by calling the generateVAPIDKeys function via some Node.js code or via its command line interface).
Regarding the why
and how is it related to Web Push
, I think the abstract of the VAPID specification is quite clear:
An application server can voluntarily identify itself to a push
service using the described technique. This identification
information can be used by the push service to attribute requests
that are made by the same application server to a single entity.
This can used to reduce the secrecy for push subscription URLs by
being able to restrict subscriptions to a specific application
server. An application server is further able include additional
information the operator of a push service can use to contact the
operator of the application server.