So, "senior" isn't a standard term.
There is no rule about "seniority", as there generally isn't a global (or even, often, country-wide) body that regulates whatever field you might be in. Maybe for pilots? I'm unsure on that. Anyway, i assume you're an engineer/IT type of some sort given the detail in your question.
Seniority thus depends on the company you're in, and the expectations they have. A senior Google engineer might be expected to know about algorithms, for example. A senior engineer at a bank might be expected to have a lot of depth of knowledge about trading systems and processes in general.
Seniority, then, is largely based on two + 1 things
- where you are
- what you know
- who you know
the first will vary - and if it requires industry exposure then can be hard to gain outside of the industry.
the second, of course, is within your control to some extent. Senior to junior isn't some magical "jump", of course, you'll have varying degrees of knowledge.
the third, as mentioned in comments, is really dependent on the industry. A senior sales person will know a lot of people, for example, and this alone will make them "senior". The more well known you are, however, can have an incredible impact on your seniority and ability to get senior roles, regardless of industry.
The other thing to note is that, generally, seniority comes with it a requirement to learn other areas outside the initial specialisation. So, you might become a senior Php person. But then you'll also need to know about unix, and databases - maybe begin to know about optimisation, or maybe python too.
As you become senior, people will come to you to ask you questions. You will thus need to be able to learn, if not actually know this knowledge (although the constant questioning will make you learn it).
This is different to becoming a manager, incidentally - a senior engineer is not the same as an engineering manager, and the two sadly require quite different skill sets, although the leap from senior engineer to engineering manager generally just expects you to pick up this knowledge.
Which is sad, as the skills required to learn the knowledge to become a senior engineer are also completely different skills to becoming an engineering manager. You cannot, for example, just "google" the solution to inter-personal difficulties as you can google why some code isn't working.