I have noticed that two cards -one CF and one SD - from the same manufacturer, with the same specifications have a significant difference in cost. The CF card costs several times more than the SD card. What is the reason for this price difference? Do CF cards have any significant advantage over SD cards in any way?
There is an advantage to Compact-Flash cards which you get with the fastest models and sufficiently fast camera. This is not what accounts for most of the price difference, volume is. SD cards are sold on considerably higher volume than CF ones. When CF cards were more popular, it used to be the opposite.
Nowadays, I would not worry at all about this. The most advantageous card is the one that fits in your camera! If you are choosing a camera, there are certainly much more significant differences to worry about than what memory cards they take. For a camera that accepts both, if you want the fastest get CF. If you want to replication, you will need both.
BTW, I have covered the technical differences here. They do not explain the price difference but may be interesting to know.
The main difference in cost probably comes from economies of scale. For a long time SD cards were more expensive, but now they've become cheaper as they've become easier to manufacture and require less materials. Meanwhile, due to their bulk, consumers have fallen out of favor with CF and prefer SD.
Additionally, the architecture of the cards is different. For SD, the controller for reading the card resides in the reader and thus readers cost more but cards cost less (but are limited by the reader). For CF on the other hand, the controller resides in the card. This allows for some interesting things like the old Microdrives that were actual hard drives inside a CF card. There were also devices like wifi modems and barcode scanners built in to CF cards. Since the controller resides in the card however, it means extra expense in the production of the cards. The faster the card, the better the controller has to be and the bigger the cost difference to a comparable SD card.
As far as which is better, it really depends on the two cards and the reader being used.
Compactflash cards are much more sturdy. SD cards flex and get squashed, so unless you have them on your camera (like if you carry extra like most serious photographers) it is much better to use CF cards. They also have better bandwidth with more pins, but mostly you wont notice that since the camera interface and cardreaders cannot fully utilize it unless you get the best of the best gear. You can get 10$ cardreaders and 50$ cardreaders, and you really feel the difference. I had a sandisk extreme III CF card and used a 10$ reader, and the transfer time was 1.5mb/s. Then I got a sandisk extreme reader for 50$ and suddenly it was 20mb/s. The studiness feature is so high a priority for me that I look for the CF slot in camera specs as a dealbreaker kinda thing. Ive had too many SD cards break , and seen other people complain that all their confeirence shots were lost on a sd card, that I avoid them. I've never seen a broken CF card. Not that I claim it cant happen, just that the frequency is so low that I havent encountered one, in the same time I encountered multiple broken SD cards.