On this page of the guide to Crash Bandicoot 4 you will find the answer to the questions - what are the tapes used for, how to unlock the special levels, and are the special levels needed for beating the game.
You can find 21 tapes on regular levels. These collectibles provide access to special levels.
The only way you can get a tape is to complete a level without dying. Additionally, you have to complete the map in order for the tape to be added to your inventory.
If you die, you have to restart the level.
To unlock the additional levels, you must obtain a tape and survive with it until the end of the level. Once you obtain the item, you no longer have to worry about your life - you can die any times you want as long as you reach the finish line.
Required for completing the game
No. You don't need to complete the additional levels to beat the game. However, if you want to complete the game in 106%, then you must complete all activities, including maxing-out the additional levels.