Price differences can occur between brands such as Bayer and Tylenol for a number of reasons. The difference in prices might be due to differences in the production costs incurred by the two firms. Bayer makes aspirin while Tylenol makes acetaminophen. These are different things and might have different costs. The difference in prices might be due to the perceptions of the brands. If one brand is more respected than the other, it might be able to charge more even if its production costs are not significantly different.
Price differences across sizes are more likely to come about because of what size of tablet the firm wants to sell. Firms often sell larger packages at lower prices per unit because the larger packages have lower packaging prices. They might also sell the larger products at lower per unit prices simply because they want to encourage people to buy more of their products.
Thus, prices can vary across brands and sizes for a number of reasons. Some of these reasons have to do with the costs of production but some of them are connected to other factors.