That is because the Bills and the Chiefs have won their divisions the last four years consecutively. The winner of the division plays the other divisions winners besides the "other" division games. Hence, the Chiefs and Bills have played each other consecutively.
There is some formula for who plays home and away based on some reciprocal function...The Bills had to play three straight at Arrowhead...and this year we get to play in Buffalo.