When a rock melts, it doesn't all melt at the same temperature, and rarely melts completely.
The first stuff to melt becomes melt/magma/lava; the stuff that doesn't melt is left behind and is called restite.
There are certain elements that usually melt first when found in a solid solution series like olivine or plagioclase (Fe before Mg, Na before Ca) and early melt is enriched in them relative to starting composition.
Clean example with Olivine
Ugly example with plagioclase. [This also explains the greasy luster: most compositions crystallize as a single mineral, then become immiscible as it cools, so the crystals separate into closely inter-layered plates of the two compositions, which is what grease does.]
Pressure might raise or lower the melting temperature, depending on some very ugly thermodynamics.
For water, increasing pressure lowers the melting/freezing temperature, which is how ice-skating works.
For most materials, including basalts, increasing pressure increases the melting temp (decreasing pressure decreases the melting temp), so once a basaltic melt starts ascending, it will not freeze unless it cools, gets trapped, or makes it to the surface. A basaltic melt that starts at point A in the diagram below is slightly above its melting temperature, but as it ascends (pressure decreases while holding temperature constant), it stays at the same temperature but its melting temperature goes down, so it's further above its melting temperature at B (the surface) than when it started. Since basalt is not a pure substance, it melts/freezes over a range of temperatures, indicated by the patterned area labeled "basalt slush".
For wet granites, increasing pressure decreases the melting temp. This means that you can melt a granite by compressing it (E to F) and freeze it by decompressing it (C to D). A granitic melt at C will freeze at D as it ascends. If some rock at E were to be buried deeper, compressing it (increase pressure while holding temperature constant) it will melt when it hits the extrapolated melting curve shown. If you have a granitic melt C and raise it (decrease pressure) D, it freezes. If you have granitic material near its melting temperature E and shove it downward F, it melts.
The pink-red area is for a granite with 6% water. The dotted line is an extrapolation/guess of the melting curve if there is unlimited water available, which gets the melting curve down towards quite plausible pressure-temperature conditions for a normal geothermal gradient in the lower part of the continental crust, which should be close to melting and so kind of plastic.
This is why compressional environments and thickening of crust are often associated with granitic melts, and extensional environments with basalts. This is also why granitic melts tend to crystallize at depth, while basaltic melts tend to make it to the surface with super-heat (heat above their melting temperature.