why do some teams play the same non-division teams so often?

For example, the 49ers have played the bucs back to back the last couple of years