The bullet in this case is just a massive piece of metal. It is accelerated to a ridiculous speed (a Navy weapon capable of hurling 40-pound projectiles at speeds of 4,500 mph to 5,600 mph over 50 to 100 miles (7,240 to 9,010 kilometers per hour over 80 to 161 kilometers). This is the advantage of railguns, very high bullet speeds. This gives the bullet a massive amount of energy.
The weapon works by basically smashing into something else, transferring most of that kinetic energy into whatever it hits which ultimately ends up as heat. This is the same reason brake pads on cars get hot, transfer of kinetic energy into heat.
When the projectile hits something and stops, the bullet and whatever it hits will get very hot. The projectile is probably made of metal which is in fact very flammable if you get enough oxygen to it. So there is a fireball, either because whatever it hits is flammable or because the projectile/whatever it hits is burning.
When you hit something that fast the behavior of metals changes. The speed of sound (see * below) in metal is high but if you hit something fast enough, then you can actually exceed the speed of sound in a metal and the rear of the projectile will carry on moving as though it hasn't hit anything when the front has hit something. This is the same idea of a shock-wave in air but it's in metal. Heres a good youtube video:
Well needless to say this tends to result in some funky stuff, like the metal bullet tearing it's self apart into lots of small pieces. This is a big driver in some anti-tank weaponry. If you hit the armour just right then you can actually get the inside of the tank to shatter, basically turning the inside of the tank into a shrapnel grenade, killing the operators.
If the projectile shatters then it's going to be hot and have a large surface area and you can get lots of oxygen to it which will result in a fireball, potentially it will burn about as hot as 1000 K. This to me seems like a good thing to design for because the added heat is going to do things like start fires and ignite conventional bullets/warheads and burn through armour.
* The speed of sound refers to the maximum speed at which a mechanical vibration (much like the pressure changes that cause sound. Not like light, RF, or electricity) can travel through a medium. Mach1 refers to that maximum speed of those wave's permeation through air, however different media such as water, metal, and glass will have different values for that maximum speed.
So, as the projectile hits some theoretical immovable object, the front will stop, but the rest will continue collapsing in on the front, faster than the pulse created on initial impact (a mechanical vibration that would otherwise influence the rear of the projectile to slow down) can travel to the rear of the projectile.
A bad, but visual representation of this is if you had a long line off cars driving down the freeway bumper to bumper. The first crashed and was brought to a halt instantaneously. In a normal crash each car behind would generally apply brakes and slow down before impact. However, for this example, everyone is driving faster than their own reaction time, so they are part of the pileup before they have registered an accident happened in the first place.