How do military radars detect the type of an aircraft?
This depends on the type of radar system and its intended application. You can find a nice bit of history on it here. The early radars could not tell the difference between aircraft types, any kind of movement was coordinated beforehand on the friendly side and anything that was not pre-arranged was considered foe. The early Doppler systems that resided on the DEW Line could be trigger by as little as a dense flock of birds. The early radar data from the DEW Line was processed on the SAGE system a very early (very primitive) system for coordinating a great deal of weather, radar, and flight information. 

After WWII and through out the cold war era newer tech was built to solve the issue of coordination. The modern Identification Friend Or Foe system that is now in use provides at least some way to pick apart radar targets. 

With the advent of modern computer processing and the ability to analyze radar returns beyond staring at a scope it is possible to determine (with great certainty) the make of an aircraft by its radar signature (and in some cases thermal signature). Also known as Radar Cross Section. Everything (even stealth planes) have a radar cross section and once a cross section has been identified it could be used again to check against future pings. 

One could go as far as to say there is some historical precedent around this. The general idea of "if it comes from over there is one of them, if it comes from over hear its one of us" is very much how radar worked for a long time and the identification of the actual plane was less important than identifying that it was there. If an unidentified target entered a radar area and did not identify its self, over the radio, with some kind of transponder and or at a preordained time it was intercepted. Not until visual identification was made was it not longer considered a threat. 



Here in the states by 2020 the civilian world will be sending speed and position data via ADS-B OUT to supplement (and potentially replace) radar returns.