Reopen Last Closed Tab on Mac in Safari v15.1 (Monterey)
Solution 1:
This isn't a new feature. Cmd/Z is a kind of 'smart' undo [& also universal to all apps & indeed all platforms]
Cmd/Shift/T is a specific command [though it does change between Tab & Window depending on what was last closed.] It's located in the History menu rather than Edit.
To test -
Start to type an answer or comment into this page. Check the Edit menu.
Close this tab, check the menu again.
Undo…
In other apps it can do even more, it is context-sensitive…
History Undo…
I've checked this back to Safari 11 on El Capitan.
It is possible to change these commands in System Prefs > Keyboard > Shortcuts but I would advise against it.