jQuery wrapper function when using Drupal behaviours
Drupal attaches behaviours on DOM ready - by waiting until the DOM is ready yourself to actually inform Drupal of your custom behaviour, it's too late (unless you call Drupal.attachBehaviors manually afterwards, which would be less than efficient).

Your 2nd example is both logically correct, and the recommended way to use behaviours with jquery in Drupal 7.

Unless you have a very good reason not to, always using that approach would be a good idea.