While much more can always be said on the topic, I summarized some contributing factors before in: The Norse people were shown to be capable raiders, especially in the British Isles. The Anglo-Saxons despite divided were socially and militarily organised, why did they, or others, never seek or attempt to attack Scandinavia?
+++
I also included a link to my previous post, The Danes or Vikings from later Denmark would often raid the Frankish Empire and later what would become the Holy Roman Empire. How were they so successful and how did the Danes avoid being conquered by the big powers?, in the linked post above - in short, chronicle authors record that Ottonian Germany in the 10th century repeatedly invaded into now southern Denmark, and once King Henry [I] of Germany (r. 918-36) defeated a ruler of the Danes named Gnupa, and forced him to subjugate as well as to accept Christianity (Widukind of Corvey, Deeds of the Saxons (res gestarum Saxonicarum), I-40, English translation is found in: [Bachrach & Bachrach trans. 2014: 58]), as following:
"After he [Henry] had defeated all of the neighboring peoples, Henry attacked and defeated the Danes with his army because they had launched naval raids against the Frisians. After he forced the Danes to pay tribute, Henry had their king, named Knuba, receive baptism."
This event is counted as one of Henry's last deeds before his death (936 CE), mentioned in the same chapter by Widukind.
It is worth noting, however, that the same author [Widukind] also mention the "second" official conversion of [another] ruler of the Danes [Harald Bluetooth] later in his book (Deeds of the Saxons, III-65, found in: [Bachrach & Bachrach trans. 2014: 139f.] without the apostasy. As I briefly alluded in: How well-accepted is Timothy Bolton's identification of Gorm the Old with Harthacnut I?, any attempt to reconstruct the political landscapes of Denmark (Jutland Peninsula) in the first half of the 10th century must remain highly speculative due to the dearth of reliable contemporary written evidence, and one possible solution of diminishing the apparent contradiction is the dynastic change or the multiple "kingdoms of the Danes and their rulers" in now southern Denmark at that time.
On the other hand, Old Norse poetry also confirms the battle between the king of Denmark (and his ally on one side) and the Saxons on another side at Danevirke (linked to Unesco's cultural heritage official site for pictures and an primer description) that built in the border area of southern Jutland.
To give an example, stanzas 27-28 of Einarr skálaglamm Helgason's skaldic poem Vellekla, dedicated to Jarl Hákon of (central and northern) Norway (d. 995), narrate the battle on this bulwark, though contemporary accounts (including this poem) contradict each other on which side actually won this battle in 974, waged by Otto II of Germany:
- St. 27: "It was not easy to go against their army, although the Rǫgnir <= Óðinn> of the fence of the spear-onslaught [(lit. ‘fence-Rǫgnir of the spear-onslaught’) BATTLE > SHIELD > WARRIOR = Hákon jarl] made a hard attack, when the battle-Viðurr <= Óðinn> [WARRIOR = Otto II] came from the south with a host of Frisians, Franks and Wends; the rider of the horse of the wave [(lit. ‘horse-rider of the wave’) SHIP > SEAFARER = Hákon jarl] called for battle (English translation is taken from the official site of Skaldic Poetry of the Middle Ages)."
- St. 28: "The din of the fire of Þriði <= Óðinn> [SWORD > BATTLE] came about, where the miðjungar of the game of arrow-points [(lit. ‘game-miðjungar of arrow-points’) BATTLE > WARRIORS] set their shields together; the eagle-feeder [WARRIOR] became aggressive. The attacking-Þróttr <= Óðinn> of the channel-horses [SHIPS > SEA-WARRIOR = Hákon jarl] drove the Saxons to flight, where the ruler with his men defended the palisade against the troops (English translation is taken from the official site of Skaldic Poetry of the Middle Ages)."
Add. References:
(Edited): adds primary source references, fixes a format a little, and typo as well.