The definition of a factory second varies from product to product.
For windows and doors usually product becomes a factory second due to: Being incorrectly entered into the system (wrong size, colour, glass type etc). Builders going bust or not paying their bill (the manufacturer then goes out and reclaims the product from site, so there may be some minor marks from where they were fixed into place). Windows and doors do tend to pick-up minor marks, scratches and dings from handling and storage but there should be no major damage on the product which would prevent it from being operational.
For timber doors being incorrectly entered into the system (incorrect size, style, glass type or finish), damaged edges and damaged veneer can result in them becoming a downgrade (factory second) product.
For steel dings, white rust, visible seams and oversupply can force manufacturers and importers to sell off the steel as a downgrade (factory second) product.
For ply film damage (on form ply), out of square sheets, damaged edges, blowing (delaminating) of layers or oversupply can contribute to the ply becoming a downgrade (factory second) product.