How does primary and secondary markets work?

click here for a more detailed description of how the primary and secondary markets work and what the differences are.