I can't understand when this happens. For example, I know such a variation 我生你的气 and 帮他的忙。 but why doesn't it happen with other similar verbs? For example 说话，吃饭，结婚?
The word (or words) 生气, 帮忙, 说话，吃饭，结婚, etc are common in their formation, which is a verb + object (VO) structure. Those words are flexible in constructing sentences. For example,
(1) Insert an adjective in the middle.
For example, 生你的气, 帮他的忙, 吃老板的饭 (have a job), 生一点儿气, 帮很大忙, 说大话，吃闲饭.
(2) Insert a past time (the past tense).
For example, 帮了忙, 吃了饭，结了婚。
(3) Insert a completion word (the completion tense).
For example, 帮过忙了, 吃过饭了，结过婚了。帮完忙了, 吃完饭了，结完婚了。
(4) Insert a negative word (the negative sentence).
For example, 帮不了忙, 吃不了饭，结不了婚。
(5) Insert an absolutely negative word (the absolutely negative sentence).
For example, 没生气, 没有生气, 没帮忙, 没有帮忙，没吃饭，没结婚。
(6) Insert an interrogation word (the interrogation sentence).
For example, 生谁的气, 帮谁的忙。
In Chinese, those sentence structures may not be correct in every case, which depends on the custom and practice. For example,
(1) 我生气了。 = 我生她的气了。 = 我和她生气了。(OK)
(2) 我吵架了。 = 我和她吵架了。(OK) but 我吵她的架了。(NOT OK)
(3) 我结婚了。 = 我和她结婚了。(OK) but 我结她的婚了。(NOT OK)
...but why doesn't it happen with other similar verbs? For example 说话，吃饭，结婚?
不要相信他说的话. - Do not believe what he said.
我剛剛才吃的飯還沒消化. - I just ate lunch/dinner, and it has not been digested yet.
他是上個月结的婚. - He was married in the last month.
In all of the above, 的 means the completion of the said action in the past.