Bethlehem was a small village. It was important because it was where King David was born. The religious leaders knew from prophecy (Matthew 1:22) that this is where God would cause his Messiah to be born there.
King David had been a shepherd when he was young. As king, he became the shepherd of Israel (2 Samuel 5:2). Micah 5:2–4 predicts the Messiah as a shepherd (compare Psalm 23:1).