var foo = function(){
this.bar = function(){alert('I am a method')}
}
This gives each foo instance a bar method of its own. So,
var car1 = new foo();
var car2 = new foo();
car2.bar = //new function definition here.
//car1.bar doesn't change.
In the second case:
foo.prototype.baz = function(){alert('I am another method')}
You are attaching a function to the prototype chain of the function foo. So, each instance gets the same method. Changing baz would change the function on each instance as each instance inherits the same function.
The advantage of the second approach is clear in terms of inheritance. Also, in the first approach, since you are attaching a method to each specific instance, it won't scale if you are creating several foo instances as each instance would unnecessarily have a copy of the same method.