Symbolism, Imagery, Allegory
The electric fence around Portland is about as literal of a symbol as you can find in any book. It keeps people in, just like the oppressive government keeps people in line. It's also a good symbol for fear. Lena says that "crossing the border is a capital offense, punishable by death" (16.13). In other words: if break the rules, you die.
However, this fence has some flaws. Alex informs Lena that it's not electrified all the way through. There are loopholes that he's able to exploit to get in and out of the city.
Same thing goes for the government's all-encompassing rules. There are some startling oversights in them. How else can you explain Alex passing as someone who has been cured of the love disease simply by making little scars on his neck? Why don't more people try that?
Well, because they're afraid of getting shocked. Or killed. Fear is a powerful tool.