Battery voltage drops under load, so if you were doing something on the phone that resulted in high current draw the voltage may dip, then when you return to "idle" current draw the voltage will increase. I'm assuming the phone has an internal mapping of battery voltage to percentage, and that is what it displays, so if the voltage drops during use and rebounds, it would probably show up as the percentage increasing.
You can also notice it if you power off the phone, often the battery percent is higher when you turn it back on, since the load is less and batteries recover some voltage when not in use.