Short answer
HubSpot's KB: Add participant to marketing event adds contacts and updates their participant state. It only works for events created manually in HubSpot; events synced from integrations don't appear.
1. In HubSpot
The relevant screen in my demo portal.

2. Worth knowing
For integration events, attendance comes from the integration.
3. Related
Marketing events and form registration.