{$IFDEF FPC} means: "if the symbol "FPC" is defined" then use the following text until the {$ELSE} or {$ENDIF. The text between {$ELSE} and {$ENDIF} is ignored when FPC is defined. In Delphi, for example, the define FPC does not exist, and Delphi ignores the part between {$IFDEF FPC} and {$ELSE} and uses the part between {$ELSE} and {$ENDIF}. This way you can use the same unit in FPC and Delphi.
{$IFNDEF FPC} has the same meaning, but with inverted logic: "if the symbol "FPC" is NOT defined"...
{$R ...} tells the IDE to link the resource files (resource = "R") specified.
If you only work with Lazarus and NEVER will use the same code in Delphi you can delete all lines in the range in which the define FPC is not active.