Many science fiction authors have foreseen a future in which machines or computers become "smarter" than humans, and enslave or exterminate them. They imagine futuristic machines as "superior" beings, and somehow this would turn mankind unnecessary. However, recent findings, mainly in artificial intelligence, robotics, and philosophy of cognitive science, suggest a different picture.
In the middle of the twentieth century, when electronic computers were beginning to be built, people had the impression that they could soon make machines which would perform several tasks that were monotonous and boring, but also others which required lots of intellectual effort for humans, like theorem proving and chess playing. It was easy to get excited and suppose that machines would be doing everything we did. But alas, as researchers kept on trying to build machines "intelligent" enough to be "better than humans", they realized that this was not an achievable task.
Yes, computers can defeat humans in several tasks. And not only chess! Mainly these involve structured information manipulation and complicated mathematical operations. Nevertheless, we can say that we beat them in much more: survival, nourishing, reproduction, adaptation, interacting with an unpredictable environment. These are things which are very hard to program.
Probably it is the case that we are making an unfair judgement while trying to compare computers with people. Suppose we would like to compare who's better: a goose or a pig. Well, better for what? To eat? To be eaten? To fly? To run? To swim? Even these questions are quite relative. Now our comparison of computers with humans is turning from unfair to silly. Which one is "better", a computer or a person? Well, for what? Computers are good at some things, not at others, and the same about us. Then why would pigs try to "take over" geese, or vice versa? The question sounds crazy. Of course it is not the same with computers and us. In this case it sounds completely insane, since we benefit from each other. Well, plainly computers would not exist without us. On the other hand, they help us tremendously, and their consequence has been described without exaggeration as the "Information Revolution". Computers and humans are better in different things, and these things are complementary.
Rather than humans or machines eliminating one another, it seems that the tendency is towards merging with each other. Just look around, and you will see computers, mobile phones, and all kind of devices, helping us in being smarter. With the aid of computers many things can be done in a better way and in less time than without them. Like books, and all cultural artifacts, they are (functionally) an extension of our mind. Can you imagine an intelligent prosthesis "rebelling" against its owner? What for? The purpose of the prosthesis is precisely to help the human.
Ok, but what if a crazy government develops robots for military purposes? Could these rebel against their makers? Well, ignoring the fact that the billions such a robot would cost when there are plenty of soldiers willing to die for their country with much cheaper death compensations for their families, in which sense these robots would be "better" than humans? There are already several robots used in the military, but these do not replace humans. They extend their abilities. In any case, for a robot to be able to "beat" a human in general, it would need to be very much like a human! And how do you build such a thing? It is practically impossible to program! And if you would like the machine to "evolve", or to "learn", it would need to interact with its environment, very much like we do, and it would take in the best case as much time as we do. Not to mention that the materials which are used for computers differ substantially with ours.
Now many people might argue that even when it is very hard, this could be possible, because it would be just a matter of approximating "enough" the functions of the brain. This would come from the argument that the functions of our brain are "computable". The notion of "computability" was formalized by Alan Turing in the 1930's, for which he used an abstract mathematical model: the Turing Machine. A computable function is then defined as one which a Turing Machine can compute. But we should be careful, and notice that Turing computability is only theoretical. Because in theory, functions which all the computers of the planet would not be able to calculate since the Big Bang, are computable. This is because a Turing Machine has infinite memory and time. And in practice, the halting function of a Turing Machine, which is non-computable for that Turing Machine, is computable (with the aid of an "oracle"). Therefore, even when in theory our brains might be computable, in practice they are very far from it.
Another argument could be to suppose that the information processing of humans is almost not compressible, meaning that it is close to maximum efficiency. Natural evolution takes care that organisms do not do much redundant things without a purpose. Therefore we could argue that a model of a human will never be "better" than a human in all aspects. But of course this does not mean that there cannot be systems "better" than a human in all aspects. However, it seems is that it is necessary, or at least much easier and more sensible, to improve the humans we already have, rather than trying to create them from scratch.
To improve actual humans we could just let evolution take its course, but it seems to be a bit slow to be conformists with it. Genetic engineering could be one option, which should be carefully revised. Another has been taking place for quite some time: culture. Genetically we are not very different from our ancestors of the last glaciation. But thanks to our culture, we can achieve much more. And machines, which are a product of our culture, have been aid us in accelerating our own improvement. Computers will not make humans obsolete because they keep upgrading us!
At this stage it is hard to keep machines separated from us. Our cognitive abilities are (functionally) linked to those of computers. It seems that with time it will be even harder to distinguish the border between man and machine, since our mutual dependence is increasing. If at that stage we decide to change our names from humans to cyborgs, it will not matter much. It will not be a replacement of humans by machines, but evolution of humans by humans.