Mortars came in various different sizes in World War 1, and were widely used by all belligerents. Sizes ranged from small portable mortars to big siege mortars that had a range exceeding 2000 meters.
Mortars had the advantage that they could be fired from the relative safety of a trench, unlike artillery. A mortar projectile followed a vertical trajectory, and because it came down almost directly above its target, it was especially effective at reaching strongpoints in the enemy trenches.
As with everything else in World War 1, it started off relatively underused. As an example, the French initially used Coehorn mortars from the Napoleonic Wars a hundred years earlier. But by the end of the war, designs had developed into the advanced mortars that continued to be used in the next world war.