IPython magics do... interesting things. Listing them is beyond the scope of this document, but here are some examples, as well as limitations.
For example, %%timeit will display how long a cell takes to run, running an appropriately large number of samples.
In [1]:
%%timeit
(+ 1 1)
In [2]:
%%%html
<ul>
<li><input type="radio" name="magic" checked="true"/> magic</li>
<li><input type="radio" name="magic"/> <a href="http://www.catb.org/jargon/html/magic-story.html">more magic</a></li>
</ul>
! will run a shell command, and show the output.
In [3]:
!ls
In [4]:
print?