Just curious how Youtube (and other video) embeds work

Is it as simple as just including a URL to the youtube page? Are some brackets needed similar to HTML formatting or BBCode? Nothing seems to be working for me. I can’t find any official documentation on how to use that feature. Thanks.