AutoSleep definitely (as the name suggests) automatically detects sleep and seems to do so pretty well, based on years of experience. Other third party apps probably do the same.
I don't know whether the native sleep function, which tested really well in terms of accuracy, detects sleep automatically. I do know that I wasn't running either a sleep schedule or a sleep Focus setting and the native sleep function was starting and ending automatically, but it's possible that it was being triggered by AutoSleep.