It is coincidental. Evolution doesn't plan.
This is why it is necessary to stretch bird nets over research-breeding beds for strawberries, to get varieties more attractive to paying human customers. Otherwise, the evolutionary pressure to be attractive to birds still heavily affects the results.
It's more of an optimization algorithm. But that's not the same as coincidence.
Co-evolution uses happy accidents all the time, but then some of those accidents get baked in, and what's left over is the result of that accident.
Peppers became more likely to be spread by birds because they became unsavory to mammals. Then what happened? And then what happened? And now we had pre-agricultural peppers, and now we have ... something else.