1) The basics are vocabulary and grammar. Without these you cannot express what you want to say intelligibly.
2) Another basic factor is pronunciation and intonation (especially in Spanish). If yours is way off then it will make communication difficult.
3) You need to acquire an ear for the language. This involves being able to recognise individual words when what you hear is an almost continuous stream of sounds.
4) You could be proficient in the above three factors but still lack fluency. Fluency is about speed and flow. It is something that requires mental agility rather than a lot of knowledge, though a good grasp of vocabulary and grammar is obviously important.
5) To become fluent you have to begin to think in the language. If instead you think in your own language and then translate then fluency is not going to happen.
6) Reading and writing are obviously important, but if the main aim is to speak then they are secondary. Skill in reading and writing can give you the misleading impression that you speak much better than you actually do.
7) As you progress to higher levels, idioms become important. It is not enough to know the literal meaning and usage of words. To be really proficient you need to understand nuances, puns, and some of the unusual phrases that cannot be translated word for word. Grammar does not always dictate word order, so you have to learn what is the natural way to speak.
8) Another factor is what I think of as the spirit of the language. This is intangible but it is something which every native speaker has from childhood. As a new learner you can imbibe this gradually until you get an idea of how the language works, so that you can guess the meaning of unfamiliar idioms and unusual constructions.
9) Errors are another important area. Even native speakers make errors, whether due to hurry, carelessness or ignorance of the rules of their language. For a learner, errors are a constant factor, one that cannot be eliminated in the short or medium term. I strongly believe that the greatest impediment to learning a language is the fear of making errors. It is best to speak a lot, even if this means erring constantly, provided we receive corrections and try to absorb them. It is important not to learn bad habits, such as translating prepositions literally from English.