It has to do with scaling, on hit interactions, and multiplication interactions.
Long story short, generally speaking in League, the more you invest in something, the more cost effective it is to continue investing in it. This is because, especially for auto attacks, you are multiplying your stats together, and the value of your items that synergize with your original investment rises exponentially.
It becomes the case that if you have a champion with already powerful on-hit effects, you want to itemize in a way that synergizes with that item. Since you want to get it as early as possible if you're getting it anyway, most people would immediately rush Devourer if they have an on-hit effect. Now that continues the chain, making you want to invest further and further into attack speed since attack speed synergizes best with Devourer, and this at the same time exponentially raises the value of Devourer. The end result is that Devourer will often be way more valuable than your Infinity Edge after fully investing into it.