Alibaba’s long-awaited IPO is finally around the corner, making this a good time to take a look at just how an IPO works.