Real estate is indeed one of the safest investments and a lot of people use real estate as an investment avenue. Real estate law is not the forte of real estate lawyers and real estate agents only. Every real estate investor should understand at least the basics of real estate law. In fact, a short course or a concise book on real estate law can sometimes be of great help (and is generally sufficient for understanding the basics of real estate law).
What you need to understand is the real estate law with respect to the legal procedures that you need to follow for ensuring a smooth transfer of title to the property you acquire/sell and other related procedures. You need to understand the fee structure (e.g. stamp duty, etc) that you need to take care of as per real estate law. You can also understand the classification of properties and how the basic real estate law applies to them. How the commercial and residential properties are treated differently by the real estate law. The tax laws with respect to real estate are one of the things that would be of most interest to you. So, your study on real estate law should also cover all the aspects related to taxes. How mortgages are treated in the perspective of real estate law is another thing that you should know about. Then again, the real estate law with respect to tenancy should also be well understood by people who wish to rent out their property.
However, you should not overdo that i.e. you should not start becoming hysterical about learning real estate law (lest you end up wasting a lot of time in trying to learn everything about real estate law and be left with no time to evaluate your real estate investment). Leave the intricacies of real estate law with the real estate lawyers (and to some extent real estate brokers who too are taught real estate law as part of their course for obtaining broker licence).
Understanding the various legal terms referred to in real estate laws can help you in not only enhancing your understanding of real estate but also help in making your conversations with real estate lawyers/agents really fruitful. You should also note that though some of the basics remain the same, the exact real estate laws can vary across Spain. Also, real estate laws (especially the tax related real estate laws) can undergo a change over a period of time, so you need to keep a tab on such changes. Any big changes will anyhow appear prominently in the media and you will get to know of them anyhow.
So knowing a little bit of real estate law can really be helpful (and is, in fact, essential).