They have a bit of everything. But their main trick was to be China before China. They simply gave the middle finger to copy rights and such crap. They went into duplicating whatever was in demand - from spare parts to socks. They banked on the fact that original spares were too expensive for consumers since they were based on monopolies.
They slowly improved on quality and soon could make better spares etc than the original manufacturers. You can call it jua kali if you will.
In some cases the manufacturers grudgingly "licensed" them to officially make the spares (Volkswagen for some of their old cars later new ones) and in others the patents / copy rights simply expired and the Turks came out in the open.
They have oil - they should being so close to Iraq etc. However the oil regions are in troubled areas where Europeans have been supporting rebellions. Nevertheless they produce enough to meet more than half of their needs. But as a big economy they need more oil than they produce.
Locked out of EU, they simply regrouped their Ottoman empire areas of Euro-Asia and looked towards Africa. They found themselves drawn together with the Russians who themselves were locked out. Some of the technology denied Iran and Russia easily reaches them these days through Turkey and they get well paid for it. That is one of the reasons the West if pissed of: Europe out of envy because they would like to have that business; and US both envy and hate.
What is their trick - they do not have natural resources - but seem they are getting it right - I guess their position as gateway to europe and asia helps - and well being the ottoman empire - they like Iran - have some huge pride and won't take shiet from EU. I wish Kenya could tap into turkey economic machines - UG, TZ and Somali are benefitting somewhat from them - in Kenya - it only the turkish airline that probably does business here. All despite Moi handing over Occalan (Kurdish leader) to turkey
Erdogan simply decided to call the whole membership application thing as the bluff it always was and set about rebuilding Turkey's identity as a Muslim state.
The bootlicking generals tried to overthrow him and he turned it against them. He used the opportunity to purge the Judiciary, military and civil service (which in Turkey is an extension not of the Executive but Judiciary with magistrates etc).
The last election (yesterday) is what Pundit calls "Fuck You Election". He gave the EU the middle finger. The opposition has been told if they start trouble by claiming rigging and such things they will pay a huge price.
I do not think the elections were rigged in Turkey proper. But I think they engineered the Kurdish areas to keep them out of Parliament.