Modern day Dutch (called Standard Dutch) and Afrikaans both have their origins in the many dialects of Dutch which were spoken in the 17th and 18th centuries.
In the 17th and 18th centuries, 'Standard Dutch' did not exist, rather one spoke their regional dialect. Those who immigrated to South Africa took their dialects with them. Once the immigrants arrived in South Africa, the language started to evolve in its own direction, as the case has been with English, Spanish, Portuguese, French and German in the new world.
And the hundreds of Dutch dialects spoken in the 17th and 18th centuries have become fewer, as the national language Standard Dutch started to evolve in the Netherlands. Still, many dialects are spoken in the Netherlands (the strongest ones are spoken in Limburg), but compared to the 17th, 18th and even the 19th centuries, far fewer dialects are spoken nowadays.
Both Afrikaans and Dutch are two different languages, but both of these languages have their roots in the many Dutch dialects spoken in the 17th and 18th centuries. It is estimated that 85 percent of the vocabulary is very similar in both languages. And in the south of the Netherlands, one can still hear the 'double negative' being used in certain dialects, which is used in Afrikaans.
Source, Bruce Donaldson, A Grammar of Afrikaans