Wrong size when setting size for h1 using em

I have h1 tag, and I tried to set the font-size for this tag using em, but instead of going larger, it became smaller. Below is my code:

h1{
font-size: 1.2em;
}

<div class="container">
<h1>This is a title</h1>
<p>hello this is a paragraph</p>
</div>

As noticed in my code, after removing the 1.2em, it becomes larger again. From my understanding, 1em = the current font size of the page. making 2em should make it double the size. 1.2em should make it a bit bigger, but for me here it's making it smaller. How does em work in this case?

You are correct regarding the definition, but there is also a default style, and the em is related to the font-size of the parent-element that has a fixed size (or the body element if no other element has fixed size).