Taken from sozoexchange.com
This is a phrase which means from the beginning or zero.
This expression is derived from the line scratched or drawn in the ground that people used as the starting line of a race. The phrase also means starting from raw ingredients.
For example, you can say, “My sister baked a cake from scratch for my birthday; she didn’t use any of those pre-mixed ingredients.”