Making Combat Challenging

A lot is made of level-appropriate material.  In D&D combat, this term is referred to as CR (Challenge Rating).  A level 4 party will be roasted alive by an ancient dragon, but will also make meaty fries out of a similarly-sized party of goblins. To avoid Total Party Kill (TPK) or Total Party Boredom, the GM/DM has plenty of options…

Find a suitable opponent
The Critical Rating is made for this.  For example, a few Manticore will provide a good battle for five level 4 adventurers.

Add more fodder until they are dangerous
A band of goblins are easy to kill off, but not so easy when they can attack 3 times more than the players can.

Strategic advantage
Weaker opponents on a flat field or dungeon floor will be easy.  But what if they are ambushing the party and get surprise attacks?  Perhaps they have the high ground and ranged weapons or you are on uneven terrain that only your opponent can move across easily. Increase the odds against the players even further by having them stealth so as not to wake even more opponents or you could have traps in place in case they charge in unprepared.

Modified creatures
If the monsters are too weak, why not give them an extra arm, a magical weapon or poisoned arrows to increase their abilities. If the monsters are too powerful, then make them aged, young or mentally addled in some way, giving them disadvantages on their rolls.  Want the creature to have a special move not in the rulebooks?  Go for it!  If it makes the combat interesting, then why not!

Playing loose
This option is fun, if played right. Create creatures with only a few stats and hit points firmly decided, and be flexible with the rest, such as their moves and attacks.  This option is a way of keeping the players on their toes and making combat challenging. However, this option can backfire is done too often; especially if it appears to directly counteract the player’s moves (e.g. “aha, it is actually immune to damage by your fireball and your ranged weapons!”).  The important thing is to have an idea of what this creature is capable of and then improvising how it might react in a fight.

As always, the most important thing is for the players to have fun.  So long as the combat element of the game is varied then they will have plenty to sink their sword or arrows into.