Genesis 30 gives us a story of something strange and superstitious that Jacob did after making an agreement with his father-in-law, Laban:
Genesis 30:31-42
31 And he said, What shall I give thee? And Jacob said, Thou shalt not give me any thing: if thou wilt do this thing for me, I will again feed and keep thy flock.
32 I will pass through all thy flock to day, removing from thence all the speckled and spotted cattle, and all the brown cattle among the sheep, and the spotted and speckled among the goats: and of such shall be my hire.
33 So shall my righteousness answer for me in time to come, when it shall come for my hire before thy face: every one that is not speckled and spotted among the goats, and brown among the sheep, that shall be counted stolen with me.
34 And Laban said, Behold, I would it might be according to thy word.
35 And he removed that day the he goats that were ringstraked and spotted, and all the she goats that were speckled and spotted, and every one that had some white in it, and all the brown among the sheep, and gave them into the hand of his sons.
36 And he set three days' journey betwixt himself and Jacob: and Jacob fed the rest of Laban's flocks.
37 And Jacob took him rods of green poplar, and of the hazel and chesnut tree; and pilled white strakes in them, and made the white appear which was in the rods.
38 And he set the rods which he had pilled before the flocks in the gutters in the watering troughs when the flocks came to drink, that they should conceive when they came to drink.
39 And the flocks conceived before the rods, and brought forth cattle ringstraked, speckled, and spotted.
40 And Jacob did separate the lambs, and set the faces of the flocks toward the ringstraked, and all the brown in the flock of Laban; and he put his own flocks by themselves, and put them not unto Laban's cattle.
41 And it came to pass, whensoever the stronger cattle did conceive, that Jacob laid the rods before the eyes of the cattle in the gutters, that they might conceive among the rods.
42 But when the cattle were feeble, he put them not in: so the feebler were Laban's, and the stronger Jacob's.
Jacob makes an agreement for wages in exchange for his continuation of service to Laban, where he will get all the discolored cattle that Laban's flocks produce.
For some background, he had already served Laban for many years. He originally agreed to serve Laban for 7 years in exchange for marrying his daughter Rachel, and then Laban tricked him by giving Jacob his elder daughter Leah instead (supernatural poetic justice - compare Genesis 29:26 with Jacob's dealings with Esau). He then served an additional 7 years for Rachel as well, and had many children thereafter, all while serving Laban.
Jacob then devises a scheme to ensure he "comes out ahead", employing some nonsense with cutting strips in rods in order to make the cattle conceive discolored kin. This leads to the assertion that the Bible records an instance of Pagan magic working.
The Bible records what Jacob did. It does not say God told him to do it. It does not say that it did anything. It records the historical fact that Jacob did this, in keeping with his scheming nature that he used to deceive his brother (Genesis 25:27-34) and his father (Genesis 27:1-36).
Ultimately, God made the strong cattle conceive discolored offspring, and Jacob could've put up one rod, a notched rod, no rods, forty stripped rods - it wouldn't have made a difference.
In the very next chapter, Jacob acknowledges this fact when speaking with his wives about how Laban has mistreated him:
Genesis 31:5-9
5 And said unto them, I see your father's countenance, that it is not toward me as before; but the God of my father hath been with me.
6 And ye know that with all my power I have served your father.
7 And your father hath deceived me, and changed my wages ten times; but God suffered him not to hurt me.
8 If he said thus, The speckled shall be thy wages; then all the cattle bare speckled: and if he said thus, The ringstraked shall be thy hire; then bare all the cattle ringstraked.
9 Thus God hath taken away the cattle of your father, and given them to me.
Even though Jacob initially thought his little scheme would work, he finally wises up and gives God the credit, because it was God alone that made the cattle conceive discolored.
God had shown up in a dream to Jacob, and made this clear - that this was His doing because He had seen Laban defrauding Jacob and dealing dishonestly with him in the past:
Genesis 31:11-13
11 And the angel of God spake unto me in a dream, saying, Jacob: And I said, Here am I.
12 And he said, Lift up now thine eyes, and see, all the rams which leap upon the cattle are ringstraked, speckled, and grisled: for I have seen all that Laban doeth unto thee.
13 I am the God of Bethel, where thou anointedst the pillar, and where thou vowedst a vow unto me: now arise, get thee out from this land, and return unto the land of thy kindred.
Therefore according to both Jacob and God, Jacob's rods had nothing to do with what eventuated. They were a superstitious scheme that even the perpetrator, in the end, gives no credence to whatsoever.
The Bible, in context, shows that this was God's doing. This records a historical attempt at magic by a great man, who was a sinner, named Jacob, and God's blessing him despite that because of his father's sake, his hard work, and the mistreatment of him by Laban.