LNAV (lateral natigation) and VNAV (vertical navigation) operate using data from the flight management computer.
On a normal B747-400 operation with a SID programmed for departure LNAV and VNAV can be armed for departure.
At 50' TOGA will change to LNAV in the roll mode and the flight director will follow instructions from the FMC to fly the SID. When the autopilot is engaged it will follow these commands. LNAV can remained engaged, follow a programmed STAR right to the destination. Normally it is only disconnected for radar vectors (HDG SEL), weather diversions (HDG SEL) or Localiser intercept (LOC).
At 400' TOGA will change to VNAV in the pitch mode and the flight director will follow instructions from the FMC VNAV page. The first speed commanded is V2+10kts to +25kts depending on current speed. VNAV will then command acceleration for flap retraction at the appropriate altitude and programmed climb speed (VNAV SPD). VNAV will not climb through or leave an MCP entered altitude (VNAV ALT). If cruise altitude on the MCP matches the altitude on the VNAV CRZ page in the FMC you will hav VNAV PTH (path) displayed on the PFD. Approaching TOD calculated by the FMC you will get the message 'Reset MCP altitude'. If the MCP altitude is below the cruise altitude the thrust will reduce to idle and descent will commence in VNAV PTH. VNAV will maintain the path up to 15kts away from the programmed speed. Outside of this VNAV SPD will be displayed and the descent profile will be left. This will normally require speedbrake to resume path with the message 'Drag Required'. VNAV will follow the speed transitions entered in the VNAV DESCENT page, such as 240kts below 10000'. It will also attempt to comply with STAR altitude restrictions. If an intermediate altitude is captured on climb or descent VNAV ALT will be displayed. Once the MCP altitude is reset the selector button must be pushed to resume the climb or descent. VNAV can remain engaged until glideslope (GS/APP) intercept.
I don't want to make this too complicated, I hope this info helps!