Artillery just means missiles today.
In WWI did artillery and mortars worked the same way only difference being the angle its being fired at, and how big the projectile is.
Prior to the mid 1850's the distinction was between:
cannons (ie guns) firing direct-fire only at trajectories near 0 degrees;
howitzers firing indirectly at higher arcs but still less than 45 degrees;
mortars firing indirectly at angles well above 45 degrees, usually near vertical.
At this time Mortars were strictly a heavy siege weapon.
The introduction of the Napoleon 12-pounder in the 1850's merged the first two categories in a single piece, a hybrid gun, capable of both direct and indirect fire. Mortars remained a separate class.
By the First World War a portable trench mortar had been developed that could be setup in a trench and firing an exploding shell with an impact fuse against enemy trenches. By the end of the war the classic Stokes 3" Mortar was seeing wide use by British and U.S. troops
A variety of howitzers ranging from 75 mm to 420 mm in calibre were used by the various sides through the early part of the war, with the massive Big Bertha howitzer able to reach Paris from over 75 miles away. By this point combat ranges and exploding shells had made direct fire largely pointless. This would remain the case until anti-tank guns and anti-aircraft guns were developed between the wars.