Conventional weapons are limited by physics constraints based on pressure waves that can't propagate faster than the speed of sound in the local atmospheric medium. Electromagnetic weapons do not have this limitation - and can thus achieve far higher velocities with commiserate increases in delivered kinetic energy and accuracy due to lower travel time.On the down side, they require a power source, and often have a lower rate of fire due to heating problems - although ejecting a case slows the reload cycle, it also acts as a removable heat-sink.
Rail guns work by having two opposed rails, with a projectile placed in between them, and then an electric charge passed through this sandwich. The resultant magnetic field drives the projectile forwards like the projection of a solenoid, albeit with a great deal more force.
This type of weapon suffers from problems with heating (both friction and electric resistance), wear, and and is often of a fairly small diameter - and rarely have an explosive filler as that wouldn't react well to the power arcing through it.
Despite these problems, rail-guns are very effective. They can accelerate projectiles to around 3.3 kilometers a second - nearly twice that of a conventional 120mm tank cannon. Kinetic energy increases exponentially - at a square of the velocity - and a 150cm long projectile can be fully expected to punch through several meters of steel. Secondary weapon systems are usually provided for dealing with other targets.
Anti-aircraft weapons are a smaller caliber due to weight and space constraints. Sufficient tracking radar can allow just a few hypersonic rounds to fired per kill, and these have the distinct advantage of giving very little warning compared to missiles - along with an inability to be decoyed or dodged. However, they are straight line weapons and as with the AT-weapons, rarely have warheads - so although missiles are out-preformed on paper, rail-guns prove a bit less suitable in reality.
As an aside - although lasers can be used against aircraft, they rarely are. Getting sufficient dwell time on a fast moving and maneuvering target is difficult, they aren't very effective against the materials modern aircraft are made of, and their energy conversion rates are terrible. Magnetic guns are on the order of three to eight times more energy efficient. Even citizen towers are backed by surface to air batteries to deal with most airborne threats.
EM Howitzers have more in common with a Mag-Lev train than other types of electric weapons. In this case, the fields allow the shell driven by conventional powder propellant to float in the barrel, and thus limit friction - the source of heating and wear. Since they aren't engaging rifling on the gun's tube, these projectiles often have either guidance fins or offset rocket motors to spin the warhead.