why does light bend even though it travels in a straight line
Light bends in order to move around an obstacle, it is just the way light behaves. The bending of light is called diffraction.