The reason you see resemblance is because its an "old" airport. Originally, airports were called by the city name. Los Angeles airport was LA, San Francisco was SF, San Jose was SJ, etc. These are the IATA codes.
But, there're not enough 2-letter combinations for all the airports, and an additional letter was added. Thus, LA became LAX (LAA is an airport in Colorado), SF became SFO (SFA is an airport in Tunisia), San Jose became SJC etc. New airports didn't have enough combinations available to follow the convention. Chicago's Orchard Field Airport became ORD (only "O" has any resemblance).
San Jose, California is SJC. But what about San Jose in Philippines? It's SJI. And San Jose in Costa Rica? It's SJO.
Other conflicts also affect the coding: for example London Gatwick Airport is LGW, because LGA is taken by the New York City LaGuardia Airport (both have LGA acronyms).
Many countries systematize the coding internally, for example many newer Canadian airports start with Y, which makes them grouped in the lists of airports. Newer 4-letter ICAO codes (not to be confused with the IATA 3-letter codes, they are not the same) have first letter (or first two) to mark the country/region K for the US (so LAX becomes KLAX), C for Canada (so Toronto YYZ becomes CYYZ), E and L for Europe, EG for the UK (making LHR changed to EGLL), etc etc. Some retain the 3 letters in the 4 letters' coding (like LAX->KLAX), some don't (like LHR->EGLL).