Example with PHP:
$example_one = "I'm going to sleep";
$example_two = 'I'm going to sleep';
The first example would show: I'm going to sleep
The second example, however, would not load. That is because the single quote used to divide "I am" into "I'm" is not assumed to be a divider, but the closing tag. In order to prevent confusing the parser, you "escape" the value to ensure that the code does not stop there. The slash does not appear in the code itself-- it's more of a "yes, there is more, keep going" icon thing.
So, the proper method would be:
$example_two = 'I\'m going to sleep';