What happens when we nest code snippets in a <figure> element?

Learnt about the <figure> element in Semantic HTML lesson. There, it depicted how images are nested inside <figure> elements to separate them from the main content. The same was shown for videos/gifs in this forum. How does that work for code snippets ?