"Happen" means to occur by accident or chance. "I walked by the deli last night, and although it was after business hours, the owner happened to be there [or, it happened that the owner was there]. He sold me two salamis." Without knowing the context of your example, I would guess that the author has added the sense of "against expectations" - "I didn't hope for much quality, since I bought the salamis on sale, but they happened to be very nice."
Student or Learner