From Andreev to Majorana bound states in hybrid superconductor-semiconductor nanowires