Weed is legal in california but illegal in the united states, and it is illegal in lots of cities. So if I have weed in my city and I have a medical card I am breaking city law, federal law, but not state law. A police office from my city can pull me over and arrest me, but then when I go to a California court I will be released. If I get noticed by a DEA agent I can go to federal court and be found guilty, but they would only do that for very large quantities. What is funny is a lot of DEA agents sole purpose is to bust into clinics in states where it is legal in the state, but since it is illegal in the USA and they are federal agents they can bust down the door, rob the place completely, confiscate all it's money, bust open it's safe in the back, and smash the place. They do it often and I believe it is just an easy way for the DEA to rake in lots of cash basically robbing and pillaging places.