Upekkha in Brahmavihara as : a mind quality, attitude of equanimity as one have firm faith, understanding of Law of Kamma.
( IMHO this BrahmaVihara is still Lokiya - subjected to samsara existence - those practicing this will ended up at Brahma realm, after that one might wander around Samsara again and again).
but as your understanding, practice and realization of Dhamma deepen, (Panna developed further) ,
Buddha encourages us to practice higher form of Upekkha Equanimity. (Lokutara) ?
By understanding, realization about the nature of internal or external, Pancakhandas, 6 based of senses (internal), external has characteristics of ;
Saṅkhataṁ (Anicca)
oḷārikaṁ (Dukkha)
paṭiccasamuppannaṁ. (Anatta)
thus Equanimity arises.
Quote :IndriyaBhavanasutta MN152
Kathañcānanda, ariyassa vinaye anuttarā indriyabhāvanā hoti? Idhānanda, bhikkhuno cakkhunā rūpaṁ disvā uppajjati manāpaṁ, uppajjati amanāpaṁ, uppajjati manāpāmanāpaṁ. So evaṁ pajānāti: ‘uppannaṁ kho me idaṁ manāpaṁ, uppannaṁ amanāpaṁ, uppannaṁ manāpāmanāpaṁ. Tañca kho saṅkhataṁ oḷārikaṁ paṭiccasamuppannaṁ. Etaṁ santaṁ etaṁ paṇītaṁ yadidaṁ—upekkhā’ti. Tassa taṁ uppannaṁ manāpaṁ uppannaṁ amanāpaṁ uppannaṁ manāpāmanāpaṁ nirujjhati; upekkhā saṇṭhāti.
And how, Ānanda, is there the supreme development of the faculties in the training of the Noble One? When a mendicant sees a sight with their eyes, in them arises what is agreeable, what is disagreeable, and what is both agreeable and disagreeable. They understand: ‘What is agreeable, what is disagreeable, and what is both agreeable and disagreeable have arisen in me. That’s conditioned, crude, and dependently originated. But this is peaceful and sublime, namely equanimity.’ Then the agreeable, the disagreeable, and the both agreeable and disagreeable that arose in them cease, and equanimity becomes stabilized. …
Read detailed more at MN 152
And how are they a practicing trainee? This is at least a stream-enterer; they still react to sense experiences that are agreeable or disagreeable, but they understand that they lead to suffering and train themselves to be freed…
Kathañcānanda, sekho hoti pāṭipado?
When a mendicant sees a sight with their eyes, the agreeable, the disagreeable, and the both agreeable and disagreeable arise in them.
Idhānanda, bhikkhuno cakkhunā rūpaṁ disvā uppajjati manāpaṁ, uppajjati amanāpaṁ, uppajjati manāpāmanāpaṁ.
They are horrified, repelled, and disgusted by that.
So tena uppannena manāpena uppannena amanāpena uppannena manāpāmanāpena aṭṭīyati harāyati jigucchati.
When they hear a sound with their ears …
Sotena saddaṁ sutvā …pe…
When they smell an odor with their nose …
ghānena gandhaṁ ghāyitvā …
When they taste a flavor with their tongue …
jivhāya rasaṁ sāyitvā …
When they feel a touch with their body …
kāyena phoṭṭhabbaṁ phusitvā …
When they know a thought with their mind, the agreeable, the disagreeable, and the both agreeable and disagreeable arise in them.
manasā dhammaṁ viññāya uppajjati manāpaṁ, uppajjati amanāpaṁ, uppajjati manāpāmanāpaṁ.
They are horrified, repelled, and disgusted by that.
So tena uppannena manāpena uppannena amanāpena uppannena manāpāmanāpena aṭṭīyati harāyati jigucchati.
That’s how they are a practicing trainee.
Evaṁ kho, ānanda, sekho hoti pāṭipado.