Lacking natural resources and being blockaded by Azerbaijan and Turkey since the beginning of the conflict, Armenia didn’t have a budget to invest into arms development and heavily relied on Russia’s military and economic help and protection.
Meanwhile, Azerbaijan has been investing into modernization of its armed forces, including the use of drones, intelligence, reconnaissance and special operations teams. Controlling the air from the first days of war (Armenia has 4 Russian made fighter jets that never engaged this time), gave Azerbaijani military a significant advantage.
Also, surrounding and stiffing the ring rather than trying to cut into the enemy forces was a different tactics than Azerbaijan used in 1990s and was more successful now.
Finally, any war at one point becomes a war of resources:
Financial – by some estimates the war costed roughly $50,000,000 a day.
Human – Armenia’s losses in the first month of the new escalation were around 5–7,000. Four months of losses at a similar rate would have eliminated 1% of a 2,000,000 Armenian population, which is catastrophic.
Armenia clearly didn’t have financial resources and was stretched on military resources, considering we are not talking about someone was given a rifle a week ago, but a soldier who went through proper training, and potentially have had prior experience in combat. For officers, it takes years to develop a professional officer (8–10 years to develop a field grade officer), so when a building with a few officers is taken out by a drone strike, besides human life loss, there’s also a capability loss.
Finally, the political factor – Russia didn’t like the pro-Western Prime Minister of Armenia and would not mind seeing him gone. Loss of a territory is a political suicide and currently Armenian protesters are looking for Armenian PM Pashinyan, breaking into his personal apartment, but he is nowhere to be found. It is also interesting, that during the signing of an agreement, there were only presidents of Russia and Azerbaijan, and the announcement of Armenia’s signature of the agreement was made by Putin in lieu of Pashinyan.