Metamorphosis of Andreev bound states into Majorana bound states in pristine nanowires