Generally, carpets are used to make spaces more beautiful and to make walking on the floor quieter. Carpets are warmer and softer than hard floors such as hardwood, tile, or concrete. Carpets may be many different sizes. Rugs and carpets originated in Central Asia, but the idea of machine manufacture was invented in Europe. So there are two different kinds of things: one is hand-made by traditional methods, and the other woven by machine. This accounts for the very great difference in style and price between traditional rugs and modern wall-to-wall carpeting.
It is common, especially in the Middle East, for rugs and carpets to be used as wall decoration, and they are designed with decoration in mind. Mass-manufactured carpets in western countries are utilitarian: for hard use on the floor, and usually self-coloured (that is one color over the whole carpet). Traditional rugs from the Middle East are hand-made and may be very expensive by the time they reach shops in the western world.
In some countries carpets are designed in a way to tell stories. They can tell history of family or something important that happened.