Like you said, obviously Apple isn't targeting those people who is shopping for inbetween of Mac Mini and IMac. However, this poster is asking why IMac is more expensive than other dell pc. That's not right comparison. Yes, we can debate all day about how Apple OS is better than MS Windows, but that's not not too important here. Every company target certain time of market.
I am keep going back to the car comparison, but like Honda or Toyota or GM, they are targeting all different types of buyers. However, if you are going to specific brand like Porsche or Mercede Benz, they have specific audience. What you are saying is like, you walked into the Mercede Benz dealer and ask them why C class is $40k at the sametime fully equiped Honda Accord is less than $30k. And you are trying telling that it's a bad business for MB to just ignore those target audience where they are shopping for $30k or less family car.
Again, comparing IMac with some other ugly black box, isn't right comparison. Like other said, apple and orange!