Hi,
I guess that the main reason for this behavior is that bash will not expand anything between single quotes, thus all will be given to sed as-is. Sed doesn't see the \' as literal ', but as a slash followed by a single quote. This being the second single quote tells sed that the command is finished, which leaves you with an incorrect command. Simple
(not fair, the inner workings of bash are sometimes hard to grasp).
Anyway hope this clears things up a bit.