Artificial gravity is the technology that would enable a machine to create gravity, or a gravity-like force. Such gravity could be portable, could be oriented in any direction, and could be adjusted in strength. Although it is possible currently to create pseudo-gravity using centripetal force or just plain magnets or velcro, true artificial gravity would presumably involve generating whatever carrier particles the force of gravity uses. Currently, theoretical and experimental models are not totally clear on how gravity works, gravitational waves and gravitons never having been detected. So it seems that artificial gravity is a long way from reality, if it is at all feasible. And since I don't want to be one of those people who doesn't understand basic calculus but feels that they can explain string theory, I will instead focus on the major role that artificial gravity plays, which is in our fiction.
Every example in televised or motion picture science-fiction that I can think of involves artificial gravity. The only exception to this that I can think of might be very near-future science-fiction dealing with interplanetary missions such as we have today. The biggest exposures to science-fiction that the average American has are Star Trek and Star Wars, both of which have flawless, invisible, omnipresent artificial gravity that the viewer doesn't even have to think about. This is also true of the many shows that follow their lead, and even some of those who don't. Even Firefly, which is realistic enough to not have faster than light travel, the ship has artificial gravity that never fails. And even Babylon 5, where the titular spaceship generates pseudo-gravity by spinning, there is still artificial gravity technology held by other civilizations.
What is especially interesting about artificial gravity is not just its omnipresence, but its flawless nature. To return to Star Trek, our prime example of science-fiction on television, every other episode involves the hapless Enterprise (of whatever call number) getting pummeled and threatened and badgered, with life support failing and back-up power only able to supply dim red lights to our threatened bridge. But never during any of this does the artificial gravity give out, despite it presumably being a technically complicated and power-hungry system. And Geordi LaForge never has to reroute the anti-gravity systems through the main deflector dish to create a phased harmonic graviton pulse to seal up a singularity. Perhaps a closer reading of the Star Trek Technical Manual would explain the matter in greater detail, but for the most part, the gravity on the Enterprise (or the Millennium Falcon, for that matter) is just there.
That being said, the presence of artificial gravity seems to be an acceptable narrative convention. Again, to go back to Star Trek, a scene where Captain Picard and Commander Riker purposely stride onto the bridge, ready to use their will and wits to solve a galactic crisis, is much more dramatically moving than one in which they stumble out of the turbolift and must stumble across the room using handholds, magnetic boots, or velcro mittens. While partisans of the Star Wars/Star Trek debate might not agree on much, they probably both agree that neither Han Solo or Captain James Tiberius Kirk were meant to wear velcro mittens. And even if, we, as the viewer, were inclined to see a realistic portrayal of gravity, it would probably be quite draining for the effects budget if every time the Enterprise got hit by a torpedo, the crew were left floating in air.
So, in other words, although the perfect, total use of artificial gravity in science fiction might not make too much sense, it is one of those things that you are just wasting your time by worrying about.