Step 1: A perfectly competitive market needs a large number of small buyers and sellers, a homogeneous product, free entry and exit, and no single participant able to influence price.
Step 2: In farming, millions of small farmers grow largely identical crops like wheat or rice and each farmer is a price taker.
Step 3: Chocolate and soft drinks are branded, differentiated products controlled by a few large firms, so they are oligopolistic, not perfectly competitive.