Amazon can undercut you whether you sell on their website or not. So can any other major corporation if your product catches their eye. Lastly this particular product was on Amazon for a decade (per article) before Amazon choose to complete. And the answer to your question is develop something you can patent or can compete in other ways that scale and price.
If you sell on Amazon's site, then they know your sales numbers. This is a specific advantage of their position as a distributor.
I run a little side-business, making a hardware gadget. My sales volume data is a sort of first-mover advantage. To compete with me, you have to risk guessing wrong about how many potential customers are out there.