iPadOS’s Safari user agent identifies itself as macOS, that’s why. Prior to iPadOS it did contain the string iPad; that was removed. So it can’t tell if it’s an iPad or a Mac with a small vertical screen, although a human would consider the former more likely.