Egyptian soldiers stand guard in front of the US National Democratic Institute, an NGO in Cairo, on 29 December 2011. Photograph: Filippo Monteforte/AFP/Getty

Imagine you live in Saudi Arabia and want to start a discussion group with some friends. The only way to do it legally is to ask the king's permission.

Musa al-Qarni dutifully wrote a letter to the king but never got a reply – so he went ahead anyway. A few months later, Qarni was arrested and carted off to jail after secret police commandos stormed the villa in Jeddah where he and several men "widely known for their advocacy on issues of social and political reform" were meeting.

In most Arab states any sort of civil society organisation, even something as innocent as a youth group or stamp-collecting club, has to be registered with the authorities, and if the authorities don't like the sound of it they may refuse or simply ignore the request, leaving the applicants in a legal limbo.

In Bahrain and Oman they can refuse permission on the grounds that the organisation is unnecessary or, in Oman's case, "for any other reasons" decided upon by the ministry of social affairs. In Qatar, if a society wants to admit non-Qatari members it must ask the prime minister first.

The right of people to get together in pursuit of shared interests or purposes is one of the building blocks of freedom. Exercising that right is the essence of civil society activity, and you can't have a flourishing democracy without a flourishing civil society.

That is why authoritarian regimes are wary of NGOs and other civil society organisations, and why they seek to control or restrict them. Such activities are viewed as subversive because they undermine the idea that the authorities always know best. Even charitable work can be considered dangerous if it draws attention to the government's failure to provide basic services.

There are several familiar techniques for asserting control. Independent initiatives may be commandeered or stifled, either by taking them over or setting up a government-controlled organisation with a similar name and purpose – a practice known in Yemen as cloning.

In Syria, Jordan and Qatar (plus Egypt under Mubarak) the nation's charitable efforts are dominated by the ruler's wife. In the Gulf states, almost all NGO-type activity is run by the government. Bahrain, for instance, has three government-run human rights organisations – which naturally helps to put a favourable spin on things.

Another technique is to create extraordinarily cumbersome but often vague rules under which NGOs are allowed to operate. Egypt is notorious in this respect and it means that if the authorities want to prosecute an organisation or close it down they can usually find some legal pretext for doing so.

Increasingly, Arab governments also seek to control funding from abroad. This is a major obstacle for NGOs in the poorer countries where local funding is difficult to obtain. Jordan, for example, introduced a law in 2008 saying that any foreign donations must be approved by the relevant minister. In the absence of specific criteria for approving them, the decision appeared to be entirely at the minister's discretion.

Viewed in this context, the raiding of NGO offices in Egypt on Thursday is not especially surprising – though, of course, one of the main goals of the revolution was to put an end to such dictatorial practices, and the raiding of 17 NGOs in a single day was unprecedented, even during the Mubarak years.

One very common tactic among beleaguered regimes is to whip up nationalist sentiment and blame their problems on foreigners – which may partly explain the ruling military council's behaviour in Egypt.

Human Rights Watch says there has been "an escalation in public rhetoric from the cabinet and the military over the past month that appears designed to delegitimise organisations that receive foreign funding".

The April 6 Youth Movement, which helped to trigger the revolution, has also been accused of receiving foreign funds to provoke a "conflict between the military and the Egyptian people".

It's a spurious argument. The idea that NGOs should not be funded from abroad holds no water at all when the Egyptian military themselves are perfectly happy to accept American taxpayers' money, and in fact depend on it. Since 1975, Egypt has received well over $50bn in US aid – much of it military. Against that, the $40m recently allocated by the US to promote democracy and human rights in Egypt is a drop in the ocean.

The real issue is not an objection to foreign money on principle. The Egyptian military want it and need it, but they also want to determine how it shall be spent. And they would rather have it spent on weapons than on irritating little NGOs that keep bleating about democracy and human rights.