The Portal Spell was a complex spell that allowed the creation of a portal through time and space.
Buffy jumps through a portal created by Shadow Puppets connected to the Slayer line and arrives in a different time, somewhere in Africa. There she meets the Shadow Men, who were the original creators of the Slayer.
The gang then attempt to bring her back by reopening the same portal. Willow is forced to utilise her powerful magic in order to perform the complex spell.
After the spell fails to work, Willow reverts to English and begins ordering unknown forces to open the portal. Once that fails, she drains the energy of Kennedy and Anya standing behind her and uses that energy to fuel the spell - therefore successfully opening the portal.
The spell works by transferring energy from one source to another by use of a mystical catalyst such as Kraken's tooth, skin of draconis or ground up Baltic stone. The caster then creates a magical circle with the catalyst (In this case a mystical sand of some sort) and then sits cross legged within the circle. The spell apparently requires the intervention of "mighty forces" in order to work. Whether or not this equates to the Powers That Be is unclear. Once the magic is successful, blue energy shoots out of the caster's arms and channels itself into a large, rectangular portal through which the intended target then materializes. The spell also needs "an exchange". One thing for another - in this case a demon for a slayer.
"Via temporis, iam clamo ad te via spatti
Te ubio, aperire...Aperi!
Via concurssus, tempos spatium admi ut imperio!"
Since the incantation for the spell is very vague (it basically translates as "open a door through time and space" though literally it means "The way the time is now to yell at you the way space You Zoological Society, open... Open! The way concurssus, administrative time, as the government") it is unclear how Willow managed to open the portal to the exact location intended. It is possible that, since higher powers are necessary for the spell's success, that they are able to open the portal to the location based off of the caster's thoughts. Another possibility is that Willow's own thoughts are what open the portal and that the incantation is just a catalyst for Willow to channel her energy. Since the exact functionality of magic is unclear in the Buffyverse, the machinations of this spell are undisclosed. Also unclear is why the spell that Willow uses opens the exact same shaped and coloured portal opened by the Shadow puppets. Again, it is possible that the spell simply reopened the portal as opposed to creating an entirely new portal.
Before beginning the spell Willow comments; "I'm kinda going by my best guess here," implying that the spell she is using is very general to begin with.