Basic cannonballs were round shots of a hard material such as stone or iron. The artillery men would load black powder into the barrel of the cannon, pack cotton wadding to compress the powder, then slide the cannon ball in, tamping it down to make a secure, compact shot. The fuse was lit, burned down to the black powder and caused a rapid expansion of gasses that pushed the cannonball down range. When the ball impacted, it imparted the force of its movement into the target object, causing damage and flinging particles of the target in all directions.
Attempts at making time-delayed explosive devices appeared as early as the 1700s, but were largely limited to mortars (a short barreled cannon intended to lob projectiles over walls rather than shooting through them). An explosive (such as black powder) would be encased in a hollow iron cannon ball and a fuse would hang out of the side. The fuse was lit, placed in the barrel of the mortar and the mortar was fired, lobbing the projectile in an arc over a wall or above enemy emplacements before exploding.
In the 1803, the British army adapted a more reliable timed explosive cannonball designed by Henry Shrapnel. It consisted of a core of explosives mixed with smaller shot and fitted with a timed fuse that was activated when the cannon was fired. These are the "bombs bursting in air" that Francis Scott Key wrote about in the Star Spangled Banner. Shrapnel's invention was more reliable than older versions (mostly because of the limited chance of the cannonball exploding before being fired) and was instrumental in Great Britain's war efforts well into the 20th century.