Note trait lets you programmatically change how some notes are created / hook into what happens during note creation. One of which is specifying what template should be applied. This is one of many ways to apply a template to a note, and it does much more than just that.
templates themselves are just notes when they are by themselves and it becomes useful when it's applied to another note either by schemas, note traits, or the
Apply Template
command.
Like
@Woods【ウオッヅ】 says, snippets are what's native to VSCode, and usually used for small bits of things that you type often (but there is nothing really stopping you from making giant snippets)