The term "flashing" has to do with the type of memory that a cell phone uses. The memory is called Flash memory. Other names it is also known by is EEPROM (electrically erasable reprogrammable Read Only memory) and nand flash. Flash memory differers from traditional ROM that is used in a PC or computer in that it is easier to reprogram but also more resistant to damage such as from drops or breaks. For example if you dropped your desktop computer in some way then there is a strong chance that by doing so you will have lost the memory contained in the ROM as it may reset itself when damaged from a drop or similar action. This is not true with cell phones and similar types of flash memory such as USB Flash Drives. They are more resistant to drops and breaks so the memory in them stays where its at instead of "resetting" itself.
When you flash something, it basically means to program or reprogram the ROM. The ROM contains some of the software or information codes that tell your device how to function. For example if you have a ROM that is customized or a ROM that is from the carrier like Sprint or Verizon it will give instructions to your device about how to act and behave, such as certain icons, available connections you can make, etc... By flashing new ROM's or other programming you may unlock or extend the capabilities of your phone or device from what was otherwise originally intended by the person you purchased it from which in this case for a cell phone would be the carriers like Sprint or Verizon. Typically the carriers want to restrict access to your phone so they program it in such a way as to do that. The way to get those restrictions out of your phone so you can unlock new features, such as being able to use on another carrier, is to flash some new software such as a ROM.
A lot of people want to know about flashing to another carrier. This generally is or is understood to be downloading the carrier files from the carrier you want to use, such as cricket or metropcs, to your phone.
Note however that this does not work for all carriers however. The basic reason why it won't work for all carriers is because your phone has certain numbers associated with it's hardware such as serial numbers, ESN numbers, MEID numbers, etc... that are preset and designed so that they, the carriers, only want you to be able to use your phone with the carrier you purchased from. For example if you purchased from Verizon, then you will have a Verizon ESN. The way it works is all of the carriers have a database of these numbers, ESN numbers, that they use when granting service. If your particular ESN number isn't in their database, then the programming will deny you access.
At this time there are only a few ways to get around this. The most common way is to call the carrier you want to use and ask them to "flash" your phone to their network. In order to do this they have to ad your phones ESN number to their database. Usually there is a fee associated with doing this such as about $10. The carriers I know of that will do this are prepaid carriers Cricket and Metropcs. Sprint and other carriers generally will not under any circumstances do it. I believe this is because they have agreements or contracts with each other so they don't compete as much as they have backdoor or behind closed door deals made with each other.
You usually won't need to do this as the carriers will generally do it for you but in order for a phone to work on another carriers network after you have your ESN number in their database which is the
Authorization for you to be able to use their service you generally have to have other compatible software as well. What software you need depends on your phone and is entirely different for every phone but you may need to do the following:
Download or update to a new PRL (Preferred Roaming List) for the new carrier you flashed to.
Download or update a new radio/baseband software version for the new carrier so that you are able to receive their specific signals (for example Verizon uses 1900 MHz and Sprint might use a 900 MHz frequency to transmite data)
Other possible though less common softwares are: PRI, checksum, or possibly even a Kernal/OS (kernal is the core programming of the Operating system), ROM, etc...
Good Luck!