Both retain and autorelease, functionally retain an object but they don't merge. The differences is that retain counts can only be decremented by another object whereas autoreleased counts are decremented automatically when the NSAutoreleasePool is drained. If no other object has retained the autoreleased object by the time the pool drains, it goes poof.
Basically, you use autorelease when you want to make sure an object hangs around in the current method and can be passed to other objects but you don't want to have to track its release yourself.
In your example code, autorelease is just a safety measure. The NSPredicate object is released because its job is finished but the coder wanted to make sure that the NSFetchRequest object hung around. You don't have to use "autorelease" in this instance but if you lost count of your releases the fetchRequest might vanish. On the other hand, you don't want it orphaned and leaking so you use autorelease to clean up when the pool the object is in drains.
The most common use of autorelease is when you are creating a variable number of objects each time. You don't want to have to track them all so you autorelease them and let the pool take care of them. (Even better, you create a local pool and drain it as soon as your done.)
In the Apple API standard, any method that creates a new object without the key words 'init','new' or 'create' returns an autoreleased object.
-[NSString initWithString:]
is not autorelease but -[NSString stringWithString:] is. This causes problems in non-Garbage collection environments because stringWithString:
returns a string that appears to behave like a retained object but later it will suddenly vanish seemingly at random when the autorelease pool it was created in drains.
Edit01: From the Apple Docs
An autorelease pool is an instance of
NSAutoreleasePool that “contains”
other objects that have received an
autorelease message; when the
autorelease pool is deallocated it
sends a release message to each of
those objects. An object can be put
into an autorelease pool several
times, and receives a release message
for each time it was put into the
pool. Thus, sending autorelease
instead of release to an object
extends the lifetime of that object at
least until the pool itself is
released (the object may survive
longer if it is retained in the
interim).
The retain counts and autorelease both keep an object alive by the same basic (but separate) count mechanism. The major difference is which owning object sends the release. With retained counts, its another object but for an autoreleased count its the autorelease pool.