All plans have an underlying SharePoint site and a dedicated Microsoft OneNote.
The SharePoint site and OneNote behind a Hub-only plan belong to the plan. These were created when the plan was created and are deleted when the plan is deleted.
The SharePoint site and OneNote behind a Teams plan belong to the Team. These were created when the Team was created and are therefore not deleted when the plan is deleted.