Howdy,
The Mail Toolbar expands and contracts as there is room to show icons and fields.
If there is enough room to show the expanded Search Field, it will. If there is not enough room, the Search Field will shrink down to the Magnifying Glass button.
If you have enough screen space, you can make your Mail window wider to accommodate a full search field, or you can eliminate buttons you don't need or use very often to make more room for search.
You can remove buttons by holding the Command key and dragging them off the Toolbar, or View > Customize Toolbar…
Note many commands have keyboard versions so you might not need them in the Toolbar, like New Message = Command N and Reply is Command R.
Also you can Show the Toolbar Buttons by Icon Only which will tighten them up and give more room for Search. For example "Show Related Messages" takes up a lot of room where just the icon doesn't. Also remove any Space or Flexible Space that may be there.
BTW, I'm not seeing a way to lock it open all the time like with Catalina. With Catalina, if the Mail window was too narrow the Search Field just went away totally with the "»" icon. At least with Big Sur, it tries to keep a search icon visible for longer with the Search Button.
ivan