What is flexbox 'align-items' doing to blocks and why?

I was beating my head into my keyboard earlier trying to understand how Mosh achieved what looked to be a “width: fit-content;” on a paragraph without specifying the width. i was at a loss for a good hour trying to find what affected the width of the paragraph. the paragraph was a child to a flex div. eventually i found that the “align-items: center;” is what made the paragraph’s width fit the content. I’m curious as to why?