Epiglottitis is caused by swelling of the epiglottis due to infectious or inflammatory causes, while croup is caused due to the swelling and inflammation of the larynx.