Very understandable, type classes + inference + monads + do notation is quite a stack of unfamiliar machinery to understand all at once.
The return type is inferred, and the type is what the type class machinery is driven by. You can get some more visibility into that by playing in ghci:
return 0 :: [Int] => [0]
return 0 :: Maybe Int => Just 0
Having behaviour driven by return type takes a bit of getting used to.