They communicate the distance and direction to the food source through dance.
Literal
Dance [by-によって] that food [until-までの] distance [and-や] direction [object-を] convey.
A reference to honeybee waggle-dance biology — bees communicate food location via dance. によって marks the means. や is the inclusive 'and' (suggests 'A, B, and others') versus と ('A and B specifically'). 方角 ('direction') specifically means compass direction, different from 方向 (general direction).